package register

import (
	"context"
	"net/http"

	"github.com/go-kratos/kratos/v2/middleware"
	"github.com/go-kratos/kratos/v2/transport/grpc"
	khttp "github.com/go-kratos/kratos/v2/transport/http"
	"github.com/spf13/cobra"
)

// 若实现此接口,则认为包含并http服务
type IHttpRouter interface {

	// 获取http router
	InstallHttpRouter(ctx context.Context, srv *khttp.Server, handler http.Handler) error
}

type IGrpcRegister interface {
	// 注册grpc服务
	RegisterGrpcServer(ctx context.Context, srv *grpc.Server) error
}

type ITransport interface {
	// 获取http中间件
	GetHttpMiddlewares() []middleware.Middleware
}

type ICmdRegister interface {
	// 自定义命令
	GetCommands() []*cobra.Command
}
